import service from '@/utils/crmRequest'

export default () => ({
    // 新建线索
    TASK_CLUE_CREATE: (data) => {
        return service({
            url: '/api/clue/create',
            method: 'post',
            data
        })
    },

    // 线索列表
    TASK_CLUE_LIST: (data) => {
        return service({
            url: '/api/clue/list',
            method: 'post',
            data
        })
    },

    // 线索详情
    TASK_CLUE_DETAIL: (id) => {
        return service({
            url: '/api/clue/detail?id=' + id,
            method: 'get',
        })
    },

    // 获取线索跟进记录
    TASK_CLUE_FOLLOW_UPS: (data) => {
        return service({
            url: '/api/clue/followUps',
            method: 'post',
            data
        })
    },

    // 线索写跟进记录
    TASK_CLUE_WRIT_FOLLOW: (data) => {
        return service({
            url: '/api/clue/writeFollowUp',
            method: 'post',
            data
        })
    },

    // 更改线索状态
    TASK_CLUE_IPDATE_STATUS: (data) => {
        return service({
            url: '/api/clue/updateStatus',
            method: 'put',
            data
        })
    },

    // 删除线索
    TASK_CLUE_DELETE: (id) => {
        return service({
            url: '/api/clue/delete?id=' + id,
            method: 'delete',
        })
    },

    // 注册客户跟进
    TASK_CUSTOMER_REGISTER: (data) => {
        return service({
            url: '/api/customer/register',
            method: 'post',
            data
        })
    },

    // 注册客户列表
    TASK_CUSTOMER_LIST: (data) => {
        return service({
            url: '/api/customer/list',
            method: 'post',
            data
        })
    },

    // 客户详情
    TASK_CUSTOMER_DETAIL: (id) => {
        return service({
            url: '/api/customer/detail?id=' + id,
            method: 'get',
        })
    },

    // 客户写跟进记录
    TASK_CUSTOMER_WRIT_FOLLOW: (data) => {
        return service({
            url: '/api/customer/writeFollowUp',
            method: 'post',
            data
        })
    },

    // 获取客户跟进记录
    TASK_CUSTOMER_FOLLOW_UPS: (data) => {
        return service({
            url: '/api/customer/followUps',
            method: 'post',
            data
        })
    },

    // 取消跟进
    TASK_CUSTOMER_CANCEL_FOLLOW_UP: (id) => {
        return service({
            url: '/api/customer/cancelFollowUp?id=' + id,
            method: 'put',
        })
    },

    // 更换跟进职员
    TASK_CUSTOMER_CHANGE_FOLLOW_STAFF: (data) => {
        return service({
            url: '/api/customer/changeFollowUpStaff',
            method: 'put',
            data
        })
    },

    // 更换合作意向
    TASK_CUSTOMER_UPDATE_CORPORATION: (data) => {
        return service({
            url: '/api/customer/updateCorporation',
            method: 'put',
            data
        })
    },

    // 检测是否可以注册
    TASK_CUSTOMER_ISREGISTER: (data) => {
        return service({
            url: '/api/customer/isRegister',
            method: 'post',
            data
        })
    },

    // 删除跟进记录
    TASK_FOLLOWUP_DELETE: (id) => {
        return service({
            url: '/api/followUp/delete?id=' + id,
            method: 'delete',
        })
    },

    // 跟进记录列表
    TASK_FOLLOWUP_LIST: (data) => {
        return service({
            url: '/api/followUp/list',
            method: 'post',
            data
        })
    },

    TASK_ALLOCATION_AGENT_CONFIRM_LIST : (data) => {
        return service({
            url:'/api/allocationAgent/confirm-list',
            method: 'post',
            data
        })
    },

    //任务分配列表
    TASK_SALE_TASK_LIST : (data) => {
        return service({
            url:'/api/saleTask/list',
            method: 'post',
            data
        })
    },

    //任务分配详情
    TASK_SALE_TASK_DETAIL : (id) => {
        return service({
            url:'/api/saleTask/detail?id=' + id,
            method: 'get',
        })
    },

    //任务分配
    TASK_ALLOCATION_AGENT_CREATE : (data) => {
        return service({
            url:'/api/allocationAgent/create',
            method: 'post',
            data
        })
    },

    //验证当前客户是否已经有对应分配信息
    TASK_ALLOCATION_HEAD_CHECK : (data) => {
        return service({
            url:'/api/allocationAgent/head/check',
            method: 'post',
            data
        })
    },

    //任务分配详情
    TASK_ALLOCATION_AGENT_FAIL_LIST : (id) => {
        return service({
            url:'/api/allocationAgent/fail/list?id=' + id,
            method: 'get',
        })
    },

    //任务待确认列表
    TASK_ALLOCATION_AGENT_WAIT_LIST : (data) => {
        return service({
            url:'/api/allocationAgent/wait-confirm-list',
            method: 'post',
            data
        })
    },

    //任务分配确认
    TASK_ALLOCATION_AGENT_DEAL : (id) => {
        return service({
            url:'/api/allocationAgent/deal?id=' + id,
            method: 'get',
        })
    },
    //任务分配确认
    TASK_ALLOCATION_AGENT_DETAIL : (id) => {
        return service({
            url:'/api/allocationAgent/detail?id=' + id,
            method: 'get',
        })
    },

    //跟进记录列表
    TASK_FOLLOW_UP_LIST : (data) => {
        return service({
            url:'/api/followUp/list ',
            method: 'post',
            data
        })
    },

    //跟进记录列表
    TASK_ALLOCATION_SEARCH_TERMINAL : (data) => {
        return service({
            url:'/api/allocationAgent/search/terminal',
            method: 'post',
            data
        })
    },

})

